package com.atguigu.lease.common.mybatisplus;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @ClassName MybatisMetaObjectHandler
 * @Author heartFade
 * @Date 2025-04-24 15:12
 * @Version 1.0
 * @Description TODO
 **/
@Component
public class MybatisMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {

        strictInsertFill(metaObject,"createTime", Date.class,new Date());
    }

    @Override
    public void updateFill(MetaObject metaObject) {
   strictUpdateFill(metaObject,"updateTime", Date.class,new Date());
    }
}
